<?php
/**
 * Modelo para la tabla tasks
 *
 */
class Tasks extends Aseregee_Db_Table {
	public function findByStatus($status) {
		return $this->fetchAll(
			$this->getAdapter()->quoteInto('task_status = ?', $status),
			'task_id'
		);
	}
	public function create($title, $status) {
		return $this->insert(array(
			'task_title'	=> $title,
			'task_status'	=> $status,
		));
	}
	public function getStatusList() {
		$data = $this->info();
		$status = $data['metadata']['task_status']['DATA_TYPE'];
		preg_match_all('/\'([\w\b]*)\'/', $data['metadata']['task_status']['DATA_TYPE'], $S);
		return $S[1];		
	}
}